package kr.hkit.powerjava.chapter08.work;

class Point {
	 private int x;
	 private int y;
	 
	 public Point(int a, int b)
	 {
	  this.x = a;
	  this.y = b;
	 }

	 public int getX() {
	  return x;
	 }

	 public void setX(int x) {
	  this.x = x;
	 }

	 public int getY() {
	  return y;
	 }

	 public void setY(int y) {
	  this.y = y;
	 }


	 public String toString() {
	  return "[x=" + x + ", y=" + y + "]";
	 }
	 
	 
	}
	public class Circle {
	 private Point cx;
	 private Point cy;
	 private double r;
	 
	 public Circle(Point cx, Point cy) {
	  this.cx = cx;
	  this.cy = cy;
	  this.setR(this.cx, this.cy);
	  this.r = this.getR();
	 }
	 
	 public double area()
	 {
	  double area = 3.14 * this.r * this.r;
	  return area;
	 }

	 public void setR(Point cx, Point cy) { 
	  this.r = java.lang.Math.sqrt(((cy.getX() - cx.getX())*(cy.getX() - cx.getX()) 
	         + (cy.getY() - cx.getY())*(cy.getY() - cx.getY()))); 
	 }
	 
	 public double getR()
	 {
	  return this.r;
	 }


	 public String toString() {
	  return "[반지름 = " + r + 
	    ", 원의 넓이 = "+ area() + "]";
	 }

	}






